
define(['jquery'], function($){
	$.dialog = {};
	$.dialog.tips = function(opts){
		var type = opts.status;
		var msg = opts.content;

		$('.alert').remove();

        var clazz = '';
        switch(type){
        case 'success':
            clazz = 'alert-success';
            break;
        case 'warning':
            clazz = 'alert-warning';
            break;
        case 'error':
            clazz = 'alert-danger';
            break;
        default:
            clazz = 'alert-success';
            break;
        }

        $('body').append('<div class="alert '+clazz+'" role="alert"><span class="info">'+msg+'</span></div>');
        $('.alert').show().animate({
            opacity:1
        }, 500);
        setTimeout(function(){
            $('.alert').animate({
                opacity:0
            }, 800, function(){
                $('.alert').remove();
            });
        }, 2000);
	}
});